package org.example.backend.controller;
import jakarta.servlet.http.HttpServletResponse;
import org.example.backend.utils.Captcha;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.WebRequest;
import java.io.IOException;

@RestController
@RequestMapping("/api")
public class CaptchaController {
    @Autowired
    private Captcha captcha;
    @GetMapping("/captcha")
    public void getCaptcha(WebRequest request, HttpServletResponse response) throws IOException {
        captcha.getCaptchaImage(request, response);
    }
}
